<div id="page_heading">
  <a href='?edit=<?php echo $pagename; ?>'>Edit This</a><br />
  Categories: <?php listCategories($page) ?><br />
  linked to by:
  <?php
  foreach($db->links->link as $link) {
    if($link['to']."" == $page['title']."") {
      echo "<a href='?show=".$link['from']."'>".$link['from']."</a>,\n";
    }
  }
  ?><br />
</div>


<div id="page_body">
<?php
if($pageexists) {
  echo textilize(parselinks($revision));
} else {
  echo "<em>this page doesn't quite exist yet, old chum</em>";
}
?>
</div>

<div id="revisioninfo">
  <span class="revision_id">
    revision <?php echo ($revision['id']+1)."/".(count($page->revision)) ?>
  </span>
  <br />
  <span class="page_date">
    <?php echo date("l, n/j/Y - g:ia",$revision['time']+0); ?>
  </span>
  <br />
  <?php
  if($revisionid == 0) {
    echo "&laquo; back";
  } else {
    echo "<a href='?show=$pagename&revision=".($revisionid-1)."'>&laquo back</a>";
  }
  echo "<strong> | </strong>";
  if($revisionid == count($page->revision)-1) {
    echo "forward &raquo;";
  } else {
    echo "<a href='?show=$pagename&revision=".($revisionid+1)."'>forward &raquo;</a>";
  }
  ?><br />
</div>